package com.haidechizi.i18n.code.generator.configuration;


import com.haidechizi.i18n.code.generator.common.message.config.GeneratorProperties;
import com.haidechizi.i18n.code.generator.common.message.file.FilePathResolverProxy;
import com.haidechizi.i18n.code.generator.common.message.file.JavaFilePathResolver;
import com.haidechizi.i18n.code.generator.common.message.file.ZipFilePathResolver;
import com.haidechizi.i18n.code.generator.common.message.generator.Generators;
import com.haidechizi.i18n.code.generator.common.message.generator.JavaStaticCodeGenerator;
import com.haidechizi.i18n.code.generator.common.message.generator.VueCodeGenerator;
import com.haidechizi.i18n.code.generator.common.message.key.DefaultKeyGenerator;
import com.haidechizi.i18n.code.generator.common.message.key.EnumKeyGenerator;
import com.haidechizi.i18n.code.generator.common.message.key.KeyGeneratorAdapter;
import com.haidechizi.i18n.code.generator.common.message.language.EnUSLanguage;
import com.haidechizi.i18n.code.generator.common.message.language.ZhCNLanguage;
import com.haidechizi.i18n.code.generator.common.message.language.ZhHKLanguage;
import com.haidechizi.i18n.code.generator.common.message.reader.FileReader;
import com.haidechizi.i18n.code.generator.common.message.translate.DefaultTranslate;
import com.haidechizi.i18n.code.generator.common.message.translate.ProxyTranslate;
import com.haidechizi.i18n.code.generator.common.message.translate.cache.DefaultTranslateCacheService;
import com.haidechizi.i18n.code.generator.common.message.translate.cache.TranslateCacheService;
import com.haidechizi.i18n.code.generator.common.message.translate.mapping.LanguageMappingInitializing;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(GeneratorProperties.class)
public class MessageCodeGeneratorConfiguration {

    @Bean
    public JavaStaticCodeGenerator javaStaticCodeGenerator() {
        return new JavaStaticCodeGenerator();
    }

    @Bean
    public VueCodeGenerator vueCodeGenerator() {
        return new VueCodeGenerator();
    }

    @Bean
    public Generators generators() {
        return new Generators();
    }

    @Bean
    public DefaultKeyGenerator defaultKeyGenerator() {
        return new DefaultKeyGenerator();
    }

    @Bean
    public EnumKeyGenerator enumKeyGenerator() {
        return new EnumKeyGenerator();
    }

    @Bean
    public KeyGeneratorAdapter keyGeneratorAdapter() {
        return new KeyGeneratorAdapter();
    }

    @Bean
    public EnUSLanguage enUSLanguage() {
        return new EnUSLanguage();
    }

    @Bean
    public ZhCNLanguage zhCNLanguage() {
        return new ZhCNLanguage();
    }

    @Bean
    public ZhHKLanguage zhHKLanguage() {
        return new ZhHKLanguage();
    }

    @Bean
    public FileReader fileReader() {
        return new FileReader();
    }

    @Bean
    public DefaultTranslate defaultTranslate() {
        return new DefaultTranslate();
    }

    @Bean
    public ProxyTranslate proxyTranslate() {
        return new ProxyTranslate();
    }

    @Bean
    public LanguageMappingInitializing languageMappingInitializing() {
        return new LanguageMappingInitializing();
    }

    @Bean
    @ConditionalOnMissingBean
    public TranslateCacheService translateCacheService() {
        return new DefaultTranslateCacheService();
    }

    @Bean
    public FilePathResolverProxy filePathResolverProxy() {
        return new FilePathResolverProxy();
    }

    @Bean
    public JavaFilePathResolver javaFilePathResolver() {
        return new JavaFilePathResolver();
    }

    @Bean
    public ZipFilePathResolver zipFilePathResolver() {
        return new ZipFilePathResolver();
    }

}
